package com.example.springaop.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2024-12-27
 * Time: 17:10
 */
@Slf4j
@Component
@Aspect
public class MyAspectDemo {
    /*
    * 前置通知*/
    @Before("@annotation(com.example.springaop.config.MyAspect)")
    public void before(){
        log.info("MyAspect -> before ...");
    }

    /*
    * 后置通知*/
    @After("@annotation(com.example.springaop.config.MyAspect)")
    public void after(){
        log.info("MyAspect -> after");
    }


}
